<!DOCTYPE html>
<html>
<head>
<title>SMART - 编辑菜单</title>
<jsp:include page="../include/head.jsp" />
</head>
<body>
   <div class="wrapper">
      <!-- 导航区 -->
      <jsp:include page="../include/topnav.jsp" />
      <!-- 左侧菜单区 -->
      <jsp:include page="../include/menu.jsp" />
      <!-- 右侧边栏 -->
      <jsp:include page="../include/right.jsp" />
      <!-- Main section-->
      <section>
         <!-- Page content-->
         <div class="content-wrapper">
            <div class="content-heading">编辑菜单</div>
            <div class="panel panel-default">
            	<div class="panel-body">
            		<jsp:include page="../include/info.jsp" />
					<form role="form" action="admin/menu/edit" method="post" class="form-horizontal">
						<c:if test="${obj!=null && obj.id ne null}">
							<input type="hidden" name="id" value="${obj.id}" />
						</c:if>
						<c:if test="${obj!=null && obj.parent ne null}">
							<div class="form-group">
								<label for="title" class="col-sm-2 control-label">父菜单</label>
								<div class="col-sm-10">
									<input type="text" class="form-control" disabled value="${obj.parent.name}" />
									<input type="hidden" name="parent.id" value="${obj.parent.id}" />
									<input type="hidden" name="level" value="${obj.parent.level + 1}" />
								</div>
							</div>
						</c:if>
						<div class="form-group">
							<label for="title" class="col-sm-2 control-label">名称(即菜单文字)</label>
							<div class="col-sm-10">
								<input type="text" class="form-control" id="name" name="name" value="${obj.name}" />
							</div>
						</div>
						<div class="form-group">
							<label for="code" class="col-sm-2 control-label">编码(字母加中划线)</label>
							<div class="col-sm-10">
								<input type="text" class="form-control" id="code" name="code" value="${obj.code}" />
							</div>
						</div>
						<div class="form-group">
							<label for="url" class="col-sm-2 control-label">URL(若无跳转则填#)</label>
							<div class="col-sm-10">
								<input type="text" class="form-control" id="url" name="url" value="${obj.url}" />
							</div>
						</div>
						<div class="form-group">
							<label for="attr1" class="col-sm-2 control-label">附加属性1(仅为一级菜单设计)</label>
							<div class="col-sm-10">
								<input type="text" class="form-control" id="attr1" name="attr1" value="${obj.attr1}" />
							</div>
						</div>
						<div class="form-group">
							<label for="attr2" class="col-sm-2 control-label">附加属性2(仅为一级菜单设计)</label>
							<div class="col-sm-10">
								<input type="text" class="form-control" id="attr2" name="attr2" value="${obj.attr2}" />
							</div>
						</div>
						<div class="form-group">
							<label for="sort" class="col-sm-2 control-label">排序(同级菜单数字越大越靠前)</label>
							<div class="col-sm-10">
								<input type="text" class="form-control" id="sort" name="sort" value="${obj.sort}" />
							</div>
						</div>
						<div class="form-group" >
							<div class="col-sm-2"></div>
							<div class="col-sm-10">
								<button type="submit" class="btn btn-primary">提交</button>
								<a href="admin/menu/list?parentId=${obj.parent.id}" class="btn btn-primary">返回列表</a>	
							</div>
						</div>
					</form>
			 	</div>
			</div>
         </div>
      </section>
      <jsp:include page="../include/footer.jsp" />
   </div>
   <jsp:include page="../include/script.jsp" />
</body>
</html>
<script>
$('#mainMenu li').removeClass('active');
$('#menuSettings').addClass('active');
</script>